#include		"GameObject.hpp"

GameObject::GameObject(int id, enum GameObjectType type, int team,
        int life, int damage, int speed, Animation& living, Animation& dying) :
_id(id),
_type(type),
_team(team),
_life(life),
_damage(damage),
_speed(speed),
_animationLiving(living),
_animationDying(dying)
{
}

int GameObject::getId() const
{
    return (this->_id);
}

int GameObject::getTeam() const
{
    return (this->_team);
}

enum GameObjectType GameObject::getType() const
{
    return (this->_type);
}

int GameObject::getLife() const
{
    return (this->_life);
}

int GameObject::getDamage() const
{
    return (this->_damage);
}

int GameObject::getSpeed() const
{
    return (this->_speed);
}

const GameObject* GameObject::getShoot1() const
{
    return (this->_shoot1);
}
const GameObject* GameObject::getShoot2() const
{
    return (this->_shoot2);
}

const sf::Sprite& GameObject::getRepresentation() const
{
    if (this->_life > 0)
        return (this->_animationLiving.getFrame());
    return (this->_animationDying.getFrame());
}

void GameObject::setLife(const int& life)
{
    this->_life = life;
}

void GameObject::setSpeed(const int& speed)
{
    this->_speed = speed;
}